package com.jackson.springencdec;

/*
 * Author: JacksonCoder
 * FileName: handler
 * Version: 1.0.0
 * Date: 2025-10-14
 */

import com.jackson.springencdec.config.RSAConfig;
import com.jackson.springencdec.utils.RSAUtils;

import java.util.Arrays;

public class handler {

    public static void main(String[] args) {

        RSAConfig rsaConfig = new RSAConfig();


        String pwd = "123456789";
        try {
            byte[] enCryptoPwd = RSAUtils.encryptByPublicKey(pwd, rsaConfig.getPublicKey());
            String encryptStr = RSAUtils.encryptBASE64(enCryptoPwd);
            System.out.println(encryptStr);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

}
